/*
 * @Author: DUST
 * @Date: 2023-05-28 15:38:23
 * @LastEditors: DUST
 * @LastEditTime: 2023-11-26 11:25:04
 * @FilePath: \business-card-system\server\app\router\index.ts
 * @Description: 
 * undefined
 */
import koaRouter from "koa-router";
import IndexController from "../controller/IndexCOntroller";
import AuthMiddleware from "../middleware/authMiddleqare";
import accountRouter from "./login";
import noteRouter from "./notes";
import businessCardUserRouter from "./businessCardUser";
import tagsRouter from "./tags";
import navigateRouter from "./navigate";
import websiteRouter from "./website";
import companyRouter from "./company";
const router = new koaRouter();

// 未开启token鉴权
router.get("/", IndexController.index);
// router.get("/token", LoginController.index);
router.use(accountRouter.routes())

// 开启token鉴权
router.use(AuthMiddleware)
router.use(noteRouter.routes());
router.use(tagsRouter.routes());
router.use(navigateRouter.routes());
router.use(websiteRouter.routes());
router.use(businessCardUserRouter.routes());
router.use(companyRouter.routes());

export default router;